random sampling from a table